package com.example.safeassistan.train.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;

import java.util.List;


public class SimulateAmswerCardAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public SimulateAmswerCardAdapter(List<String> data) {
        super(R.layout.item_answer_card, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        if (item!=null){
            switch (item) {
                case "1":
                    helper.getView(R.id.tvNumber).setBackgroundResource(R.drawable.blue_circle_48);
                    break;
                case "3":
                    helper.getView(R.id.tvNumber).setBackgroundResource(R.drawable.gray_circle_48);
                    break;
                case "2":
                    helper.getView(R.id.tvNumber).setBackgroundResource(R.drawable.yellow_circle_48);
                    break;
            }
        }

        helper.setText(R.id.tvNumber,(helper.getPosition()+1)+"");
    }
}
